<html lang="en-US">

<head>
    
<title>linux系统安装并使用杀毒软件 - 花落雨忧</title>

<meta property="og:title" content="linux系统安装并使用杀毒软件 - 花落雨忧">



    



    
    <meta property="description" content="Step1: 安装
[&amp;hellip;] # 安装之前更新一下系统软件包 centos: sudo yum update ubuntu: sudo apt update &amp;amp;&amp;amp; sudo apt upgrade # 安装 centos: sudo yum -y install clamav clamav-daemon ubuntu: sudo apt install clamav &amp;hellip;">
    <meta property="og:description" content="Step1: 安装
[&amp;hellip;] # 安装之前更新一下系统软件包 centos: sudo yum update ubuntu: sudo apt update &amp;amp;&amp;amp; sudo apt upgrade # 安装 centos: sudo yum -y install clamav clamav-daemon ubuntu: sudo apt install clamav &amp;hellip;">
    






<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1">

<link rel="shortcut icon" href="https://www.lican.asia/logo/logo.png" type="image/x-icon" />



<link rel="stylesheet" href="/css/style.min.css" />

<link rel="stylesheet" href="/css/reset.min.css" />




<script src="https://www.lican.asia/js/highlight.min.js"></script>

<script>
hljs.configure({ ignoreUnescapedHTML: true })
hljs.highlightAll();
</script>


<script src="https://www.lican.asia/js/jquery.min.js"></script>




<link href="https://www.lican.asia/css/hugo-code.min.css" rel="stylesheet" />



    <style>
        .post-content img {
            max-width: 400px;
        }
    </style>
</head>

<body id="period" class="home blog">
    <a class="skip-content" href="#main">Press "Enter" to skip to content</a>
    <div id="overflow-container" class="overflow-container">
        <header class="site-header" id="site-header" role="banner">
    <div class="max-width">
        <div id="title-container" class="title-container">
            <div id="site-title" class="site-title"><a href="/">花落雨忧</a></div>
            <p class="tagline">思所及 力所行 方为真.</p>
        </div>
        
        <div id="menu-primary-container" class="menu-primary-container">
            <div class="icon-container">
            </div>
            <div id="menu-primary" class="menu-container menu-primary" role="navigation">
                <nav class="menu">
                    <ul id="menu-primary-items" class="menu-primary-items">
                        
                        
                        <li id="menu-item-0"
                            class="menu-item menu-item-type-custom menu-item-object-custom ">
                            <a href="/posts" aria-current="page" tabindex="0">首页</a></li>
                        
                        <li id="menu-item-1"
                            class="menu-item menu-item-type-custom menu-item-object-custom ">
                            <a href="/tech/" aria-current="page" tabindex="1">技术文档</a></li>
                        
                        <li id="menu-item-2"
                            class="menu-item menu-item-type-custom menu-item-object-custom ">
                            <a href="/article/" aria-current="page" tabindex="2">文章</a></li>
                        
                        <li id="menu-item-3"
                            class="menu-item menu-item-type-custom menu-item-object-custom ">
                            <a href="/project/" aria-current="page" tabindex="3">项目</a></li>
                        
                        <li id="menu-item-4"
                            class="menu-item menu-item-type-custom menu-item-object-custom ">
                            <a href="/about/" aria-current="page" tabindex="4">关于</a></li>
                        
                    </ul>
                </nav>
            </div>
        </div>
    </div>
</header>

        <div id="primary-container" class="primary-container">
            <div class="max-width">
                <section id="main" class="main" role="main">
                    <div id="loop-container" class="loop-container">
                        <div
                            class="post type-post status-publish format-standard hentry entry">
                            <article>
                                <div class="post-container">
                                    <div class="post-header">
                                        <h2 class="post-title">
                                            <a href="/tech/%E5%AE%89%E8%A3%85%E5%B9%B6%E4%BD%BF%E7%94%A8clamav/">linux系统安装并使用杀毒软件</a>
                                        </h2>
                                        
                                    </div>
                                    <div class="post-content">
                                        <h3 id="linux系统安装并使用杀毒软件">linux系统安装并使用杀毒软件</h3>
<h4 id="扫描工具clamav">扫描工具：Clamav</h4>
<ul>
<li>ClamAV 杀毒是Linux平台最受欢迎的杀毒软件。</li>
<li>支持多种平台，如：Linux/Unix、MAC OS X、Windows、OpenVMS。</li>
<li>ClamAV 是基于病毒扫描的命令行工具，但同时也有支持图形界面的ClamTK 工具。</li>
</ul>
<p>Step1: 安装</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-go" data-lang="go"><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">安装之前更新一下系统软件包</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">centos</span>: <span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">yum</span> <span style="color:#a6e22e">update</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">ubuntu</span>: <span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">apt</span> <span style="color:#a6e22e">update</span> <span style="color:#f92672">&amp;&amp;</span> <span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">apt</span> <span style="color:#a6e22e">upgrade</span>
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">安装</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">centos</span>: <span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">yum</span> <span style="color:#f92672">-</span><span style="color:#a6e22e">y</span> <span style="color:#a6e22e">install</span> <span style="color:#a6e22e">clamav</span> <span style="color:#a6e22e">clamav</span><span style="color:#f92672">-</span><span style="color:#a6e22e">daemon</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">ubuntu</span>: <span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">apt</span> <span style="color:#a6e22e">install</span> <span style="color:#a6e22e">clamav</span> <span style="color:#a6e22e">clamav</span><span style="color:#f92672">-</span><span style="color:#a6e22e">daemon</span>
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">版本查看</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">clamscan</span> <span style="color:#f92672">--</span><span style="color:#a6e22e">version</span>
</span></span></code></pre></div><p>Stpe2: 更新病毒库</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-go" data-lang="go"><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">先停止clamav</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">systemctl</span> <span style="color:#a6e22e">stop</span> <span style="color:#a6e22e">clamav</span><span style="color:#f92672">-</span><span style="color:#a6e22e">freshclam</span>
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">更新病毒库</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">freshclam</span>
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">重启clamav并设置开机自启动</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">systemctl</span> <span style="color:#a6e22e">enable</span> <span style="color:#a6e22e">clamav</span><span style="color:#f92672">-</span><span style="color:#a6e22e">freshclam</span> <span style="color:#f92672">--</span><span style="color:#a6e22e">now</span>
</span></span></code></pre></div><p>Step3: 执行扫描</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-go" data-lang="go"><span style="display:flex;"><span><span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">clamscan</span> <span style="color:#f92672">-</span><span style="color:#a6e22e">r</span> <span style="color:#f92672">/</span>
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">该命令仅能扫描出被感染的文件或程序</span><span style="color:#960050;background-color:#1e0010">，</span><span style="color:#a6e22e">如果要扫描后自动删除</span><span style="color:#960050;background-color:#1e0010">，</span><span style="color:#a6e22e">携带参数</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">--</span><span style="color:#a6e22e">remove</span>
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">扫描并移除感染文件</span>(<span style="color:#a6e22e">慎用</span>)
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">clamscan</span> <span style="color:#f92672">-</span><span style="color:#a6e22e">r</span> <span style="color:#f92672">/</span> <span style="color:#f92672">--</span><span style="color:#a6e22e">remove</span>
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">将扫描结果输出到文件</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">clamscan</span> <span style="color:#f92672">-</span><span style="color:#a6e22e">r</span> <span style="color:#f92672">/</span> <span style="color:#f92672">-</span><span style="color:#a6e22e">l</span> <span style="color:#f92672">/</span><span style="color:#a6e22e">path</span><span style="color:#f92672">/</span><span style="color:#a6e22e">to</span><span style="color:#f92672">/</span><span style="color:#a6e22e">logfile</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#960050;background-color:#1e0010">#</span> <span style="color:#a6e22e">扫描完成后</span><span style="color:#960050;background-color:#1e0010">，</span><span style="color:#a6e22e">clamav会输出报告</span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">-----------</span> <span style="color:#a6e22e">SCAN</span> <span style="color:#a6e22e">SUMMARY</span> <span style="color:#f92672">-----------</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">Known</span> <span style="color:#a6e22e">viruses</span>: <span style="color:#ae81ff">8696712</span>        				<span style="color:#75715e">//病毒库总数
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">Engine</span> <span style="color:#a6e22e">version</span>: <span style="color:#ae81ff">0.103.11</span>       				<span style="color:#75715e">//版本
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">Scanned</span> <span style="color:#a6e22e">directories</span>: <span style="color:#ae81ff">60379</span>   				<span style="color:#75715e">//扫描文件夹数
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">Scanned</span> <span style="color:#a6e22e">files</span>: <span style="color:#ae81ff">299909</span>           			<span style="color:#75715e">//扫描的文件总数
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">Infected</span> <span style="color:#a6e22e">files</span>: <span style="color:#ae81ff">0</span> 	   	      			    <span style="color:#75715e">//感染文件数
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">Total</span> <span style="color:#a6e22e">errors</span>: <span style="color:#ae81ff">26865</span>  					   <span style="color:#75715e">//这些错误可能由多种原因引起，如文件权限、文件系统损坏、磁盘错误或扫描过程中的其他中断
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">Data</span> <span style="color:#a6e22e">scanned</span>: <span style="color:#ae81ff">18863.32</span> <span style="color:#a6e22e">MB</span> 					<span style="color:#75715e">//实际扫描数据大小
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">Data</span> <span style="color:#a6e22e">read</span>: <span style="color:#ae81ff">36136.95</span> <span style="color:#a6e22e">MB</span> (<span style="color:#a6e22e">ratio</span> <span style="color:#ae81ff">0.52</span>:<span style="color:#ae81ff">1</span>) 		 <span style="color:#75715e">//扫描读取数据大小
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">Time</span>: <span style="color:#ae81ff">3982.683</span> <span style="color:#a6e22e">sec</span> (<span style="color:#ae81ff">66</span> <span style="color:#a6e22e">m</span> <span style="color:#ae81ff">22</span> <span style="color:#a6e22e">s</span>) 				<span style="color:#75715e">//耗时
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">Start</span> <span style="color:#a6e22e">Date</span>: <span style="color:#ae81ff">2024</span>:<span style="color:#ae81ff">08</span>:<span style="color:#ae81ff">06</span> <span style="color:#ae81ff">15</span>:<span style="color:#ae81ff">50</span>:<span style="color:#ae81ff">46</span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">End</span> <span style="color:#a6e22e">Date</span>:   <span style="color:#ae81ff">2024</span>:<span style="color:#ae81ff">08</span>:<span style="color:#ae81ff">06</span> <span style="color:#ae81ff">16</span>:<span style="color:#ae81ff">57</span>:<span style="color:#ae81ff">09</span>
</span></span></code></pre></div><p>如果在centos下安装失败：启用EPEL仓库</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-go" data-lang="go"><span style="display:flex;"><span><span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">yum</span> <span style="color:#a6e22e">install</span> <span style="color:#a6e22e">epel</span><span style="color:#f92672">-</span><span style="color:#a6e22e">release</span>
</span></span></code></pre></div><p>然后</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-go" data-lang="go"><span style="display:flex;"><span><span style="color:#a6e22e">sudo</span> <span style="color:#a6e22e">yum</span> <span style="color:#a6e22e">install</span> <span style="color:#a6e22e">clamav</span> <span style="color:#a6e22e">clamav</span><span style="color:#f92672">-</span><span style="color:#a6e22e">server</span> <span style="color:#a6e22e">clamav</span><span style="color:#f92672">-</span><span style="color:#a6e22e">update</span>
</span></span></code></pre></div>

                                        
                                    </div>

                                    

                                    

                                    
                                    
                                    

                                </div>
                            </article>
                        </div>
                    </div>
                </section>
                <aside class="sidebar sidebar-primary" id="sidebar-primary" role="complementary">
    <h1 class="screen-reader-text">Sidebar</h1>
    

    
    
    <section id="text-2" class="widget widget_text">
        <div class="textwidget">
            
            <div id="profile">
                <div id="profile_picture"><img src="https://www.lican.asia/logo/logo.png"></div>
                <div id="profile_intro">
                    <p><span class="name">Lican</span></p>
                    <p class="intro">全栈开发者，爱好造轮子。</p>
                </div>
            </div>
            
            <p>
                <script type="text/javascript">
                    (function ($) {
                        $(document).ready(function () {
                            var menuPrimaryContainer = $('#menu-primary-container');
                            var profile = $('#text-2');
                            $('#toggle-navigation').click(function () {
                                if (menuPrimaryContainer.hasClass('open')) {
                                    profile.removeClass('open');
                                } else {
                                    profile.addClass('open');
                                }
                            });
                        });
                    })(jQuery);
                </script>
            </p>
        </div>
    </section>
    
    
    
    
    
    <section id="text-5" class="widget widget_text">
        <h2 class="widget-title">开源项目</h2>
        <div class="textwidget">
            <div id="projects" style="line-height: 22px;">
                
                <a href="https://github.com/idoubi/gonews"
                    target="_blank">gonews</a>: &nbsp;Daily news for golang<br>
                
                <a href="https://github.com/idoubi/sql2struct"
                    target="_blank">sql2struct</a>: &nbsp;Generate go struct according to SQL<br>
                
                <a href="https://github.com/idoubi/goz"
                    target="_blank">goz</a>: &nbsp;Request library used in golang<br>
                
        </div>
    </section>
    
    

    
    
    
    
    <section id="qrcode" class="widget widget_media_image">
        <h2 class="widget-title">微信公众号</h2>
        <img width="258" height="258"
            src="https://www.lican.asia/wechat/lican.png"
            class="image wp-image-5514  attachment-full size-full" alt=""
            style="max-width: 100%; height: auto;"
            sizes="(max-width: 258px) 100vw, 258px">
    </section>
    
    

    
    
    

    
    
    

    
    
    
    
</aside>
            </div>
        </div>

        <footer id="site-footer" class="site-footer" role="contentinfo">
    <div class="max-width">
    </div>
    <div class="footer">
        <div id="footercontent">
            © lican.asia All rights reserved<br/>
            Built with Hugo Theme <a href="https://github.com/idoubi/hugo-theme-period" target="_blank">Period</a>
        </div>
    </div>
</footer>

<script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?e8351b6d4626d5881d439ea1f6184baa";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
</script>
    
    
    </div>
    
</body>

</html>